/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.Contingency.impl;

import EA_Model.IEC61970.Contingency.Contingency;
import EA_Model.IEC61970.Contingency.ContingencyPackage;

import EA_Model.IEC61970.Core.impl.IdentifiedObjectImpl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Contingency</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.Contingency.impl.ContingencyImpl#getMustStudy <em>Must Study</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ContingencyImpl extends IdentifiedObjectImpl implements Contingency {
	/**
	 * The cached value of the '{@link #getMustStudy() <em>Must Study</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMustStudy()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Boolean mustStudy;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ContingencyImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return ContingencyPackage.Literals.CONTINGENCY;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Boolean getMustStudy() {
		if (mustStudy != null && mustStudy.eIsProxy()) {
			InternalEObject oldMustStudy = (InternalEObject)mustStudy;
			mustStudy = (EA_Model.IEC61970.Domain.Boolean)eResolveProxy(oldMustStudy);
			if (mustStudy != oldMustStudy) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, ContingencyPackage.CONTINGENCY__MUST_STUDY, oldMustStudy, mustStudy));
			}
		}
		return mustStudy;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Boolean basicGetMustStudy() {
		return mustStudy;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMustStudy(EA_Model.IEC61970.Domain.Boolean newMustStudy) {
		EA_Model.IEC61970.Domain.Boolean oldMustStudy = mustStudy;
		mustStudy = newMustStudy;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ContingencyPackage.CONTINGENCY__MUST_STUDY, oldMustStudy, mustStudy));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case ContingencyPackage.CONTINGENCY__MUST_STUDY:
				if (resolve) return getMustStudy();
				return basicGetMustStudy();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case ContingencyPackage.CONTINGENCY__MUST_STUDY:
				setMustStudy((EA_Model.IEC61970.Domain.Boolean)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case ContingencyPackage.CONTINGENCY__MUST_STUDY:
				setMustStudy((EA_Model.IEC61970.Domain.Boolean)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case ContingencyPackage.CONTINGENCY__MUST_STUDY:
				return mustStudy != null;
		}
		return super.eIsSet(featureID);
	}

} //ContingencyImpl
